﻿<?php
if (!defined('BASEPATH')) exit('No direct script access allowed'); 
class Message
{
	function showmessage($content, $continue=-1, $status = 1) {
		$continue = ($continue == -1) ? 'history.go(-1)' : 'window.location="'.site_url($continue).'"';
		$waits = ($status == 0) ? 'setTimeout("thisUrl()", 2500)' : 'setTimeout("thisUrl()", 1500)';
		$status = ($status == 0) ? 'color:#FF0000' : 'color:#009900';
		$string = "<div class='box'>\n<h5>提示信息</h5>\n<p class='content'>".$content."</p>\n<p class='clickUrl'>
			如果浏览器没有自动跳转，请 <a href='javascript:;' onClick='".$continue."'>点击这里</a></p>\n</div>"; 
		$style = "<style>\nbody,h5,p,a{font:12px Verdana,Tahoma;text-align:center;text-decoration:none;margin:0;padding:0;}
			\nh5{color:#555;font-size:14px;height:28px;text-align:center;line-height:28px;font-weight:bold;background:
			#EEE;margin:1px;padding:0 10px;} \n.box{width:480px;border:1px solid #DDD;margin:120px auto;-moz-box-shadow:
			3px 4px 5px #EEE;-webkit-box-shadow:3px 4px 5px #EEE;}\n.content{".$status.";font-size:14px;font-weight:bold;
			line-height:24px;padding:30px 10px;}\n.clickUrl{color:#888;margin-bottom:15px;padding:0 10px;}\n</style>";
		$html = "<!DOCTYPE html>\n<html>\n<head>\n<title>提示信息</title>\n<meta http-equiv='Content-Type' content='text/html;
			charset=utf-8'/>\n".$style."\n<script type='text/javascript'>\nfunction thisUrl(){".$continue."}\n".$waits."\n
			</script>\n</head>\n<body>\n".$string."\n</body>\n</html>";
		exit($html);
	}
}
/**
 * 信息提示页面
 * @$content 要提示的文字
 * @$continue 即将跳往的页面，返回用“-1”
 * @$status 提示状态，值为0,1或其它，0为错误提示(红色)，1为正常提示（绿色）
 */


?>